package steffens.java.gui.defaultui.interactive.buttons.eventbased;

import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;

import javax.swing.Icon;
import javax.swing.ImageIcon;

import steffens.java.gui.defaultui.interactive.buttons.DefaultButton;
import steffens.java.gui.defaultui.interactive.listener.ButtonEventListener;

public class DefaultEventButton extends DefaultButton{

	public static final Dimension DEFAULT_SIZE = new Dimension(32,128);
	public static final Icon DEFAULT_ICON = new ImageIcon();
	public static final String DEFAULT_TEXT = "DEFAULT";
		
	/** */
	private static final long serialVersionUID = 1L;

	private List<ButtonEventListener> buttonEventListeners = new ArrayList<>();
	
	/**
	 * 
	 */
	public DefaultEventButton() {
		this(DEFAULT_TEXT, DEFAULT_ICON, DEFAULT_SIZE);
	}

	/**
	 * @param text
	 */
	public DefaultEventButton(String text) {
		this(text, DEFAULT_ICON, DEFAULT_SIZE);
	}
	
	/**
	 * @param icon
	 */
	public DefaultEventButton(Icon icon) {
		this(DEFAULT_TEXT, icon, DEFAULT_SIZE);
	}
	
	/**
	 * @param size
	 */
	public DefaultEventButton(Dimension size) {
		this(DEFAULT_TEXT, DEFAULT_ICON, size);
	}
	
	/**
	 * @param text
	 * @param icon
	 * @param size
	 */
	public DefaultEventButton(String text, Icon icon, Dimension size) {
		super(text, icon,size);
	}

	public List<ButtonEventListener> getButtonEventListeners(){
		return buttonEventListeners;
	}
	
	public boolean addButtonEventListeners(ButtonEventListener buttonEventListener){
		return buttonEventListeners.add(buttonEventListener);
	}
	
	public boolean addAllButtonEventListeners(List<ButtonEventListener> buttonEventListeners){
		return buttonEventListeners.addAll(buttonEventListeners);
	}
	
	public boolean removeButtonEventListeners(ButtonEventListener buttonEventListener){
		return buttonEventListeners.remove(buttonEventListener);
	}
	
	public boolean removeAllButtonEventListeners(List<ButtonEventListener> buttonEventListeners){
		return buttonEventListeners.removeAll(buttonEventListeners);
	}
}	
